import {Platform, NativeModules} from 'react-native';

export default {

    async printCmd(type: string, targetDevice: string, content: string) {
        if (Platform.OS === 'android') {
            try {
                await NativeModules.Print.printCmd(type, targetDevice, content);
            } catch (e) {
                console.log(e.message);
            }
        } else {
            //其它环境暂未实现
        }
    },

    async printCmdList(type: string, targetDevice: string, content: string[]) {
        if (Platform.OS === 'android') {
            try {
                await NativeModules.Print.printCmdList(type, targetDevice, content);
            } catch (e) {
                console.log(e.message);
            }
        } else {
            //其它环境暂未实现
        }
    }
}
